import { Component } from '@angular/core';
import { startAutoAuth } from './scripts/AuthUtil'
import { HttpRouter } from './service/httpRouter'
import { HttpService } from './service/httpService'

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.less']
})
export class AppComponent {

  public member:any = {};
  public menuStatus = false;
  constructor(
    private httpRouter : HttpRouter,
    private httpService : HttpService
  ){}

  ngOnInit() {
    startAutoAuth("yoparent","edu");
    this.getMember();
  }

  getMember(){
    this.httpService.get(this.httpRouter.getMemberUrl).subscribe(data => {
      if(data.code === "10200"){
        this.member = data.data;
      }
    });
  }

  openSilder(){
    this.menuStatus = true;
  }
  colsedSilder(){
    this.menuStatus = false;
  }

}
